<!DOCTYPE html>
<html>
	<head>
		<meta charset="UTF-8">
		<title></title>
	</head>
	<body>
		
	</body>
	<script>
		//工厂函数
		function Car(a,e,b,c){
			var stu = new Object();
				stu.name=a;
				stu.time=e;
				stu.price=b;
				stu.read=c;
			return stu;
		}
		var stu1 = Car('保时捷','20160128','150万','高端');
		var stu2 = Car('宝马','20170301','100万','大气');
		var stu3 = Car('奔驰','20181619','50万','上档次');
		console.log('出厂了一部'+stu1.name+',价值'+stu1.price+',出厂时间'+stu1.time+',这款车'+stu1.read);
		console.log('出厂了一部'+stu2.name+',价值'+stu2.price+',出厂时间'+stu2.time+',这款车'+stu2.read);
		console.log('出厂了一部'+stu3.name+',价值'+stu3.price+',出厂时间'+stu3.time+',这款车'+stu3.read);
		
		//构造函数
		function friend(a,b,c,d,e,f){
			this.name=a;
			this.age=b;
			this.sex=c;
			this.has=d;
			this.art=e;
			this.dose =f;
		}
		var xiaoming = new friend('小明','18','男','男朋友','跳舞','黑天鹅');
		var xh = new friend('小红','12','女','女朋友','举重','大杠铃');
		console.log(xiaoming.name+',今年'+xiaoming.age+'岁,'+'有'+xiaoming.has+',会'+xiaoming.art+',会跳'+xiaoming.dose);
		console.log(xh.name+',今年'+xh.age+'岁,'+'有'+xh.has+',会'+xh.art+',会举'+xh.dose);
	</script>
</html>
